1. Field of the Invention
This invention relates to a method and apparatus for generating reference values for a motion control loop in an industrial control system. In a particularly preferred embodiment, the invention relates to a method and apparatus for generating reference information in which a motion profile is defined that comprises multiple polynomial segments.
2. Description of Related Art
Industrial control systems are used in a wide variety of industrial operations such as manufacturing, processing, packaging, and so on. Typically, industrial control systems comprise one or more industrial controllers, such as programmable logic controllers, which control a plurality of output devices based on input status information from a plurality of input devices. Often, one or more of the output devices is an electric motor, which is commanded to perform various operations during the operation of the industrial control system.
To control electric motors in an industrial control system, motion control systems are utilized. Typically, a motion control system comprises a motion controller and a servo drive. In combination, the motion controller and the servo drive implement a position control loop, a velocity control loop, and a torque or current control loop. The position control loop operates to minimize the difference between a commanded position of the rotor shaft and the actual position of the rotor shaft. The velocity control loop, which is nested within the position control loop, receives a velocity command from the position control loop and operates to minimize the difference between a commanded velocity of the rotor shaft and the actual velocity of the rotor shaft. The torque/current control loop is nested within the velocity control loop. (Because torque/current magnitudes are proportional, the same control loop can be viewed as either a torque control loop or a current control loop.) The torque/current control loop, which receives a torque/current command from the velocity control loop, operates to minimize the difference between a commanded torque/current and the actual torque/current. In combination, therefore, the motion controller and the servo drive are capable of accepting a position command and in response generating current to drive the motor and thereby to control the motor to obtain the commanded position. Specific examples of commercially available motion controllers are Allen-Bradley's Logix.TM. motion controllers, Allen-Bradley's IMC.TM. motion controllers, which are available as stand-alone units or as PLC-based units, as well as Electro-Craft's PRO motion controllers. Specific examples of commercially available servo drives are Allen-Bradley's 1391 and 1394 servo drives, as well as Electro-Craft's BRU and BRU Advantage Line servo drives. Sometimes, a motion controller and a servo drive are packaged as a single product, as in the case of Electro-Craft's IQ-Series.RTM. servo drives.
Industrial control systems typically operate based on execution of a user program that is tailored to the industrial control system and its intended use. In an industrial control system that comprises one or more industrial controllers, the user program may comprise one or more subprograms that are executed by the industrial controllers. In a simpler industrial control system that comprises a stand-alone motion control system, the user program may be contained in the motion controller.
According to existing approaches, industrial control systems are typically programmed using sequential programming languages. In a sequential programming language, the user program is displayed in the form of a series of commands that are executed sequentially. The commands at the user's disposal include move and jog commands, for example, that allow the user to control movement of the motor.
The move and jog commands operate within various limit conditions that constrain operation of the motor to within certain parameters. For example, a maximum velocity, a maximum acceleration, a maximum deceleration, a maximum jerk during acceleration and a maximum jerk during deceleration may be specified. These parameters may be specified based on the performance characteristics of the motor, or based on the application for which the motor is used. For example, it may be undesirable for the motor to operate at higher than a given velocity or at higher than a given rate of acceleration, even though the motor is capable of doing so, in order to prevent malfunctioning or damage in the controlled system.
Based on these parameters, when a move command is encountered in a user program, the motion controller attempts to cause the motor to accelerate at maximum acceleration towards maximum velocity. Typically, this occurs through the generation of a series of position references that are provided as position commands to the position control loop, with new position references being provided every few milliseconds or so.
Ideally, position references are generated that allow the motor to move as quickly as possible from the initial position to the new position while staying within the bounds defined by the above-mentioned parameters. To this end, the motion control system monitors the current position, velocity and acceleration of the motor, and recalculates new position references on the fly based on the current position, velocity, and acceleration of the motor, so as to move the motor shaft as quickly as possible to its new position, while staying within the bounds defined by the above-mentioned parameters.
There are therefore several disadvantages to existing approaches. First, existing approaches are computationally intensive. The calculations that are required to ensure that each position reference is optimized to cause the motor to move as quickly as possible, while staying within the bounds defined by the above-mentioned parameters, are performed on the fly for each position reference. Essentially, therefore, the calculations are performed "starting from scratch" for each new position reference. This slows execution and diverts computational resources away from other tasks.
Additionally, due to the sequential manner in which move commands are executed, most existing approaches require that the motor have zero velocity (i.e., stopped) at the beginning of the execution of the move command. This is disadvantageous because it limits the flexibility given to the user in writing the user program. In some circumstances, it is desirable to be able to begin executing a move command when the motor has a non-zero initial velocity.
Additionally, existing algorithms generally assume that position references will be generated at regular intervals. In other words, in interrupt-based systems, for example, existing algorithms generally require that the interrupts that cause the generation of a new position reference value be equidistantly spaced in time. In non-deterministic program execution environments, however, interrupts may not be generated at regular intervals and some interrupts may even be missed. Programming environments that are not completely deterministic are common and include, for example, Windows NT. In these environments, due to the fact that interrupts are not always generated at equal time intervals, the algorithms begin to operate in a non-optimal fashion.
Therefore, a method and apparatus for generating reference values for a motion control loop in an industrial control system that overcomes one or preferably all of these drawbacks would be highly advantageous.